package com.dyz.wsw.front.market.controller;

import com.dyz.wsw.common.consts.web.SecurityConst;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

import java.util.Objects;

/**
 * @author dyz
 * @date 2025/2/15 22:03
 */
@RestController
public class TestController implements SecurityConst {
    @GetMapping("/a")
    Mono<String> hello(ServerWebExchange exchange){
        HttpHeaders headers = exchange.getRequest().getHeaders();

        System.out.println(headers);
        return Mono.just(Objects.requireNonNull(headers.get(AUTHENTICATION_USER_ID)).toString());
    }

}
